package wh.crm.service;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import wh.crm.domain.Customer;

public interface CustomerService {

	//查询所有未关联的客户
	@Path("/noassociationcustomers")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> findNoAssociationCustomers();
	
	//查询已经关联的客户
	@Path("/associationfixedareacustomers/{fixedAreaId}")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> findAssociationFixedAreaCustomers(
					@PathParam("fixedAreaId") String fixedAreaId);
	
	//关联客户与定区
	@Path("/associationcustomertofixedarea")
	@PUT
	@Produces({"application/xml","application/json"})
	public void associationCustomerToFixedArea(
			@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);
	
	//保存客户
	@Path("/savecustomer")
	@POST
	@Produces({"application/xml","application/json"})
	public void regist(Customer customer);
	
	//根据手机号查询用户
	@Path("/telephone/{telephone}")
	@GET
	@Produces({"application/xml","application/json"})
	public Customer findByTelephone(@PathParam("telephone") String telephone);
	
	//变更Type属性
	@Path("/updateType/{telephone}")
	@PUT
	@Produces({"application/xml","application/json"})
	public void updateType(@PathParam("telephone") String telephone);
	
	//登录
	@Path("/login/")
	@GET
	@Produces({"application/xml","application/json"})
	public Customer login(
			@QueryParam("telephone") String telephone,
			@QueryParam("password") String password);
	
	//根据Customer_id 查到用户所在的FixedAreaId
	@Path("/findFixedAreaIdByCustomerId/{customer_id}")
	@GET
	@Produces({"application/xml","application/json"})
	public String findFixedAreaIdByCustomerId(@PathParam("customer_id") Integer customer_id);
	
	
}
